package com.yuw.homework04;

public class SalariedEmployee extends ColaEmployee {
    // 属性
    private double employeeSalary;
    // 行为

    public SalariedEmployee() {
    }

    public SalariedEmployee(String employeeName, int employeebirthMonth, double employeeSalary) {
        super(employeeName, employeebirthMonth);
        this.employeeSalary = employeeSalary;
    }

    public double getEmployeeSalary() {
        return employeeSalary;
    }

    public void setEmployeeSalary(double employeeSalary) {
        this.employeeSalary = employeeSalary;
    }

    // 重写父类的计算工资的方法

    @Override
    public double getSalary(int month) {
        // 重写:重新计算工资
        return super.getSalary(month) + this.employeeSalary;
    }

    @Override
    public void pirntSalary(int currentMoth) {
        System.out.println(this.getEmployeeName() + "工资：" + getSalary(currentMoth));
    }
}
